<template>
  <div class="mini-chart">
    <div class="chart-content" :style="{height: 46}">
      <v-chart :force-fit="true" :height="height" :data="dataSet" :padding="[36, 5, 18, 5]">
        <v-tooltip />
        <v-bar :position="p" />
      </v-chart>
    </div>
  </div>
</template>

<script>

const tooltip = [
  'x*y',
  (x, y) => ({
    name: x,
    value: y
  })
]

const scale = [{
  dataKey: 'x',
  min: 2
}, {
  dataKey: 'y',
  title: '时间',
  min: 1,
  max: 10000000
}]

export default {
  name: 'MiniBar',
  props: {
    dataSet: {
      type: Array,
      required: true
    },position: {
      type: String,
      required: true
    }
  },
  created(){
    this.p = this.position
  },
  data () {
    return {
      p:'',
      scale,
      tooltip,
      height: 100
    }
  }
}
</script>

<style lang="less" scoped>
@import "index.less";
</style>
